home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / source / gfxfx / tstscr.pas < prev    next >
Pascal/Delphi Source File  |  1994-06-22  |  2KB  |  60 lines

  1.  
  2. program tweaked_tweaked_textscroll;
  3. { scroll test, type some stuff! By Bas van Gaalen, Holland, PD }
  4. uses crt;
  5. const
  6.   tseg : word = $b800; hi = 45;
  7.   txt : string = 'howdy world...      ';
  8.   cpos : array[0..46] of word = (
  9.     0,5,12,19,26,33,40,47,54,61,65,72,80,87,97,104,111,118,125,132,139,146,
  10.     153,160,170,177,184,191,195,200,205,211,215,222,227,232,240,247,252,259,
  11.     266,273,280,287,294,301,308);
  12.   clen : array[0..46] of byte = (
  13.     2,7,7,7,7,7,7,7,7,4,7,7,7,10,7,7,7,7,7,7,7,7,7,10,7,7,7,4,5,5,6,4,7,5,
  14.     5,4,7,5,7,7,7,7,7,7,7,7,6);
  15.   {$i chars.inc} { make this with makeset.pas and follow instructions. ;-) }
  16.  
  17. var
  18.   pos : word; i,cur,idx,len,line : byte;
  19.  
  20. procedure retrace; assembler; asm
  21.   mov dx,3dah;
  22.   @l1: in al,dx; test al,8; jnz @l1;
  23.   @l2: in al,dx; test al,8; jz @l2; end;
  24.  
  25. begin
  26.   textmode(co80+font8x8);
  27.   idx := 1;
  28.   repeat
  29.     cur := ord(readkey);
  30.     if cur = 27 then halt;
  31.     case cur of
  32.       32 : cur := 0;
  33.       33 : cur := 31;
  34.       39 : cur := 29;
  35.       40,41 : dec(cur,7);
  36.       44 : cur := 28;
  37.       45 : cur := 30;
  38.       46 : cur := 27;
  39.       47 : cur := 46;
  40.       48..57 : dec(cur,12);
  41.       58 : cur := 35;
  42.       63 : cur := 32;
  43.       65..90 : dec(cur,64);
  44.       97..122 : dec(cur,96);
  45.     end;
  46.     pos := cpos[cur];
  47.     len := clen[cur];
  48.  
  49.     for i := 0 to len-1 do begin
  50.       retrace;
  51.       for line := 0 to 4 do begin
  52.         move(mem[tseg:(hi+line)*160+2],mem[tseg:(hi+line)*160],158);
  53.         memw[tseg:158+(hi+line)*160] := chars[line,pos+i];
  54.       end;
  55.     end;
  56.  
  57.     idx := 1+idx mod length(txt);
  58.   until false;
  59. end.
  60.